package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.WellControlB233;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class WellControlB233Converter implements AttributeConverter<WellControlB233, String> {
    @Override
    public String convertToDatabaseColumn(WellControlB233 wellControlB233) {
        return JSONUtil.toJsonStr(wellControlB233);
    }

    @Override
    public WellControlB233 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, WellControlB233.class);
    }
}
